﻿@using DAL
@model DAL.Blog
@{
    ViewBag.Title = "Blog";

}
<link href="~/Content/blog.css" rel="stylesheet" />
<h1>@Model.Title</h1>

<div class="BlogContent">
    @foreach (var post in Model.BlogPost)
    {
        if (!post.Deleted)
        {
            <div class="BlogEntry">
                @Html.Partial("_BlogPost", post)
            </div>
        }
    }
</div>
<div class="BlogRollContent">
    @using (Html.BeginForm("AddBlogRoll", "Blog",new {id = Model.BlogId}))
    {
        @Html.TextBox("Link")
        <input type="submit" value="Add"/>
    }
    
    <br/><br/>
    @foreach (var roll in Model.BlogRollLink)
    {
        if (!roll.Deleted)
        {
            <p>
                <a href="http://@roll.Link" target="_blank">@roll.Link</a>&nbsp;&nbsp;&nbsp;(@Html.ActionLink("Delete","DeleteBlogRollLink","Blog",new{id=roll.BlogRollId}, new { @class="deleteLink" }))
            </p>
        }
       
    }
</div>